package com.ws.controller;

import com.ws.entity.Goods;
import com.ws.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by WUSONG on 2017/11/30.
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @GetMapping(value = "/{goodsId}")
    public Goods getGoods(@PathVariable Integer goodsId){
        return goodsService.findById(goodsId);
    }

    @Autowired
    private GoodsService goodsService;
}
